home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Scribefire-1.4.2 / scribefire-1.4.2-fx+fl.xpi / chrome / content / performancingUtil.js < prev    next >
Encoding:
Text File  |  2007-07-24  |  20.4 KB  |  537 lines

  1. /*
  2. Utility javascript
  3. --------------------------------
  4. A poor attempt to keep all reusable functions here
  5. */
  6.  
  7. //Addon Topics
  8. const PERFORMANCING_ADDON_PFFSTART_TOPIC = "performancing-addon-pffstart-topic";
  9. const PERFORMANCING_ADDON_PFFENABLE_TOPIC = "performancing-addon-pffenable-topic";
  10. const PERFORMANCING_ADDON_PFFDISABLE_TOPIC = "performancing-addon-pffdisable-topic";
  11. const PERFORMANCING_ADDON_PFFTABCLICK_TOPIC = "performancing-addon-pfftabclick-topic";
  12.  
  13. //General Topics
  14. const PERFORMANCING_STATE_CHANGED_TOPIC = "performancing-update-ui-topic"; //Not used (yet)
  15. const PERFORMANCING_STATE_LOADBLOGS = "loadblogs"; //Not used (yet)
  16. const bfPwdPrefix = "performancing:";
  17. function performancingUtil() {
  18.     this._observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
  19.     this._observerService.addObserver(this, PERFORMANCING_ADDON_PFFSTART_TOPIC, false);
  20.     this.prefsService = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService);
  21.     this.prefs = this.prefsService.getBranch("performancing.");// Get the "firefax." branch
  22.     //Usage: this.prefs.getCharPref("user.default"); getBoolPref, getIntPref
  23.     //       this.prefs.setCharPref("user.default", "User Name"); setBoolPref, setIntPref
  24.     this.currentURL = null;
  25.     this.currentPass = null;
  26.     this.charType = null;
  27.     this.serviceObject = null;
  28.     this.serviceObjectXML = null;
  29.     try{
  30.       this._performancingService  = Components.classes["@performancing.com/performancing/PerformancingService;1"].getService();
  31.       this._performancingService = this._performancingService.QueryInterface(Components.interfaces.nsIPerformancingService);
  32.       this.myJSService = Components.classes["@performancing.com/performancing/PerformancingService;1"].getService(Components.interfaces.nsISupports).wrappedJSObject;
  33.     }catch (e) {
  34.       alert("Could not load nsIPerformancingService: " + e);
  35.       //return false; 
  36.     }
  37. }
  38.  
  39.  
  40. //gPerformancingUtil.onBrowerClose();
  41. performancingUtil.prototype.onPFFWindowClose = function(){
  42.     gPerformancingNotes.doNoteOnUnload();
  43. }
  44.  
  45. performancingUtil.prototype.init = function(){
  46.     try{
  47.         this._performancingService.init("");
  48.         performancingUI.init();
  49.         loadPerFormancingNotes(); //Keep this one last incase we get errors
  50.         pffAddonSkin.loadLastSkin();//Load the users last UI CSS
  51.         var aTimer = window.setTimeout("gPerformancingUtil.sendAddonInitNotification('"+PERFORMANCING_ADDON_PFFSTART_TOPIC+"','');", 1000, false);
  52.     }catch(e){
  53.         //Will cause error when launched from somewhere else like the account wizard
  54.         //unless you load with true parameter
  55.          alert("Start Up Error: " + e);
  56.     }
  57. }
  58.  
  59. performancingUtil.prototype.sendAddonInitNotification = function(aTopic, aData){
  60.     //this._performancingService.callAddonInit();
  61.     this._performancingService.callNotification(aTopic, aData)
  62. }
  63.  
  64.  
  65.  
  66. performancingUtil.prototype.observe = function(aSubject, aTopic, aData){
  67.     //if(aTopic == PERFORMANCING_ADDON_PFFSTART_TOPIC){
  68.         //alert('Saw Notification in UTIL');
  69.         //this.reloadBlogs();
  70.     //}
  71. }
  72.  
  73. performancingUtil.prototype.printLog = function(theServiceMessage){
  74.     this._performancingService.printLog(theServiceMessage);
  75. }
  76.  
  77. //Only for Wizard *not yet used*
  78. performancingUtil.prototype.processReturnData = function(theObject){
  79.     var isError = true;
  80.     var theClass = "performanceblog";
  81.     
  82.     if(theObject.length == null){
  83.         if(theObject.faultString){
  84.             //dump("\nLogin Error: " + theObject.faultString + "\n")
  85.             isError = true;
  86.         }else{
  87.             //dump('\nError processReturnData #1 : Unknown State\n');
  88.             isError = true;
  89.         }
  90.     }else{
  91.         isError = false;
  92.         //dump("\nLogin Success!\n")
  93.         //dump("Response Length: "+theObject.length + "\n");
  94.         
  95.         //gBlogObject = theObject;
  96.         //dump("Response Length: "+theObject.length + "\n");
  97.  
  98.  
  99.         gPerformancingUtil.emptyElement('blog-group-rows');
  100.         var tempArray = [];
  101.         for(j = 0; j < theObject.length; j++){
  102.             tempArray = [theObject[j].blogName, theObject[j].url, theObject[j].url];
  103.             //dataArray, number, listIDname, theGUID, theURL, onItemClick, aDate, aPostId, theClass
  104.                                              //dataArray, number, listIDname, theGUID, theURL, onItemClick, aDate, aPostId, theClass
  105.             gPerformancingUtil.addItemToList(tempArray, j, 'performancing-wizard-blog-list', null, null, null, null, null, theClass );
  106.         }
  107.     }
  108.     
  109.     if(!isError){
  110.         //document.getElementById('performancing-account-wizard').getPageById('login').next = "finish";
  111.         //document.getElementById('performancing-account-wizard').advance("success");
  112.         return true;
  113.     }else{
  114.          //document.getElementById('performancing-account-wizard').getPageById('login').next = "login-error";
  115.          //document.getElementById('performancing-account-wizard').advance("login-error");
  116.          return true;
  117.     }
  118. }
  119.  
  120. /*
  121. <blog>
  122.     <blogname>{theBlogName}</blogname>
  123.     <blogtype>{theBlogType}</blogtype>
  124.     <appkey>{theAppKey}</appkey>
  125.     <username>{theUserName}</username>
  126.     <apiurl>{theAPIURL}</apiurl>
  127.     <GUID>{theGUID}</GUID>
  128.     <url>{theURL}</url>
  129.     <blogid>{theBlogID}</blogid>
  130. </blog>
  131. */
  132.  
  133. //TODO: Make more generic for re-use!!
  134. performancingUtil.prototype.loadXMLFIle = function(){
  135.     var ourDeck = document.getElementById('performancing-account-deck');
  136.     var theClass = "performanceblog";
  137.     var file = gPerformancingUtil.getXMLFile();
  138.     var f2 = PerFormancingFileIO.open(file.path);
  139.     var theXMLString = null;
  140.     if(f2.exists()){
  141.         theXMLString = PerFormancingFileIO.read(file, "UTF-8");
  142.         var theBlogXML = new XML(theXMLString);
  143.         
  144.         //dump("Number of Blogs in File: " +theBlogXML..blog.length() + "\n");
  145.         var numberOfBlogs = theBlogXML..blog.length();
  146.         if(numberOfBlogs > 0){
  147.             ourDeck.setAttribute('selectedIndex','0');
  148.             gPerformancingUtil.emptyElement('blog-group-rows');
  149.  
  150.             for(var x = 0; x < numberOfBlogs; x++){
  151.         var blog = theBlogXML..blog[x];
  152.         gPerformancingUtil.addBlogToGroup(blog.blogname, blog.url, blog.GUID, blog.datecreated);
  153.             }
  154.  
  155.             gLastXMLBlogObject = theBlogXML;
  156.             var theBlogUID = null;
  157.             var theBlogURL = null;
  158.             if(numberOfBlogs == 1){
  159.                 theBlogUID = theBlogXML..blog[0].GUID;
  160.                 theBlogURL = theBlogXML..blog[0].url;
  161.                 gPerformancingUtil.prefs.setCharPref("settings.lastselected.blog", theBlogUID );
  162.                 performancingUI.setBlogAsSelected(theBlogUID, theBlogURL);
  163.             }else{
  164.                 try{
  165.                     theBlogUID = gPerformancingUtil.prefs.getCharPref("settings.lastselected.blog")
  166.                     
  167.                     window.setTimeout("performancingUI.showCurrentBlog('"+theBlogUID+"', null)", 1000, true);
  168.                 }catch(e){
  169.                     
  170.                 }
  171.             }
  172.         }else{
  173.             ourDeck.setAttribute('selectedIndex','1');
  174.         }
  175.     }else{
  176.         //dump('PerFormancing XML File does not exists!');
  177.         ourDeck.setAttribute('selectedIndex','1');
  178.     }
  179.     
  180. }
  181.  
  182. //TODO: Make more generic for use with Notes!
  183. performancingUtil.prototype.getXMLFile = function(){
  184.     var file = PerFormancingDirIO.get("ProfD");
  185.     file.append("extensions");
  186.     file.append(bloglistxmlfile);
  187.     var theBlogXML = null;
  188.     
  189.     return file;
  190. }
  191.  
  192. performancingUtil.prototype.addBlogToGroup = function (name, url, guid, date) {
  193.     var group = document.getElementById("blog-group-rows");
  194.     
  195.     var row = document.createElement("row");
  196.     var r = document.createElement("radio");
  197.     r.setAttribute("id","blog-" + group.getElementsByTagName("radio").length);
  198.     r.setAttribute("blogGUID",guid);
  199.     r.setAttribute("tooltiptext", url);
  200.     r.setAttribute("date", date);
  201.     r.setAttribute("onclick","performancingUI.onBlogSelect(this);");
  202.  
  203.     var link = document.createElement("label");
  204.     link.setAttribute("value",name);
  205.     link.setAttribute("tooltiptext", url);
  206.     link.setAttribute("onclick","performancingUI.openInTab('" + url + "');");
  207.     link.setAttribute("class","link");
  208.  
  209.     row.appendChild(r);
  210.     row.appendChild(link);
  211.     group.appendChild(row);
  212. };
  213.  
  214. performancingUtil.prototype.addItemToList = function(dataArray, number, listIDname, theGUID, theURL, onItemClick, aDate, aPostId, theClass){
  215.     var list = document.getElementById(listIDname);
  216.     var item = document.createElement('listitem');
  217.     item.setAttribute('id', 'blog-' + number);
  218.     item.setAttribute('blogGUID', theGUID);
  219.     item.setAttribute('tooltiptext', theURL);
  220.     item.setAttribute('date', aDate);
  221.     item.setAttribute('postid', aPostId);
  222.     item.setAttribute('onclick', onItemClick);
  223.     item.setAttribute('class', theClass);
  224.     
  225.     for(var i=0; i < dataArray.length; i++){
  226.         var itemCell = document.createElement('listcell');
  227.         itemCell.setAttribute('label', dataArray[i]);
  228.         itemCell.setAttribute('crop', 'right');
  229.         itemCell.setAttribute('class', theClass + '2');
  230.         item.appendChild(itemCell);
  231.     }
  232.     //Append the elements
  233.     list.appendChild(item);
  234.     //sizeToContent();
  235. }
  236.  
  237. performancingUtil.prototype.addItemToCheckList = function(dataArray, number, checkListIDname, theGUID, aCategory, onItemClick, AType, isChecked){
  238.     if(isChecked != true){
  239.         isChecked = false;
  240.     }
  241.     
  242.     var checkList = document.getElementById(checkListIDname);
  243.     if(AType != 'label'){
  244.         var checkbox = document.createElement('checkbox');
  245.         checkbox.setAttribute('id', 'blog-' + number);
  246.         checkbox.setAttribute('cat', aCategory);
  247.         checkbox.setAttribute('checked', isChecked);
  248.         for(i=0; i < dataArray.length; i++){
  249.             checkbox.setAttribute('label', dataArray[i]);
  250.             checkList.appendChild(checkbox);
  251.         }
  252.     }else{
  253.         var label = document.createElement('label');
  254.         label.setAttribute('id', 'blog-' + number);
  255.         label.setAttribute('value', dataArray[0]);
  256.         checkList.appendChild(label);
  257.     }
  258. }
  259.  
  260. performancingUtil.prototype.emptyElement = function (groupID) {
  261.     var group = document.getElementById(groupID);
  262.     while (group.lastChild) group.removeChild(group.lastChild);
  263. };
  264.  
  265. performancingUtil.prototype.clearListOut = function(listIDname){
  266.     var list=document.getElementById(listIDname);
  267.     while(list.getRowCount() > 0){
  268.         list.removeItemAt( list.getRowCount() - 1);
  269.     }
  270. }
  271.  
  272. performancingUtil.prototype.clearCheckListOut = function(checkListIDname){
  273.     var checkList = document.getElementById(checkListIDname);
  274.     while( checkList.hasChildNodes() ){
  275.         checkList.removeChild( checkList.firstChild );
  276.     }
  277. }
  278.  
  279. //gPerformancingUtil.convertFromUnicode(theOldText, encodingType); //"iso-8859-1"
  280. performancingUtil.prototype.convertFromUnicode = function(aOldText, encodingType){
  281.     var uniConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
  282.     uniConverter.charset = encodingType; //"iso-8859-1"
  283.     var theNewText = uniConverter.ConvertFromUnicode(aOldText);
  284.     return theNewText;
  285. }
  286.  
  287. performancingUtil.prototype.getCharType = function(){
  288.     if(this.charType == null){
  289.         try{
  290.             this.charType = gPerformancingUtil.prefs.getCharPref("settings.defaults.encoding");
  291.         }catch(e){
  292.             this.charType = "UTF-8";
  293.         }
  294.     }
  295.     return this.charType;
  296. }
  297.  
  298. //We get the password, if it doesn't exist, we prompt user for the password.
  299. performancingUtil.prototype.goGetPassword = function(aUserName, aURL){
  300.     //If same as last call, we've cached the password.
  301.     if(this.currentURL == aURL){
  302.         return this.currentPass;
  303.     }else{
  304.         var thePassword = gPerformancingUtil.usermanagment.getPassword(aUserName, aURL);
  305.         if(thePassword){
  306.             this.currentURL = aURL;
  307.             this.currentPass = thePassword;
  308.             return thePassword;
  309.         }else{
  310.             var localeString = performancingUI.getLocaleString('pleaseenterpassword', [aURL]);
  311.             var theUserPassword = prompt(localeString);
  312.             var addedUser = gPerformancingUtil.usermanagment.storeLoginDetails(aUserName, theUserPassword, aURL);
  313.             this.currentURL = aURL;
  314.             this.currentPass = theUserPassword;
  315.             return theUserPassword;
  316.         }
  317.     }
  318. }
  319.  
  320. performancingUtil.prototype.usermanagment = {
  321.     storeLoginDetails : function(myUserName, aPassword, aURL){
  322.         // Get Password Manager (does not exist in Firefox 3)
  323.         var CC_passwordManager = Components.classes["@mozilla.org/passwordmanager;1"];
  324.         var CC_loginManager = Components.classes["@mozilla.org/login-manager;1"];
  325.  
  326.         if (CC_passwordManager != null) {
  327.             // Password Manager exists so this is not Firefox 3 (could be Firefox 2, Netscape, SeaMonkey, etc).
  328.             var newURL = bfPwdPrefix + aURL;
  329.  
  330.             if(myUserName){
  331.                 this._passwordManager = CC_passwordManager.createInstance();
  332.                 
  333.                 if (this._passwordManager) {
  334.                     this._passwordManager = this._passwordManager.QueryInterface(Components.interfaces.nsIPasswordManager);
  335.  
  336.                     try{
  337.                         this._passwordManager.removeUser(newURL, myUserName);
  338.                     } catch (e) {
  339.                     }
  340.  
  341.                     if (aPassword) {
  342.                         this._passwordManager.addUser(newURL, myUserName, aPassword);
  343.                         return true;
  344.                     }  
  345.                 } else {
  346.                     return false;
  347.                 }
  348.             }
  349.  
  350.             return false;
  351.         }
  352.         else if (CC_loginManager!= null) {
  353.             // Login Manager exists so this is Firefox 3
  354.             var newURL = bfPwdPrefix + aURL;
  355.  
  356.             if (myUserName) {
  357.                 this._passwordManager = CC_loginManager.getService(Components.interfaces.nsILoginManager);
  358.                 var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1", Components.interfaces.nsILoginInfo, "init");
  359.                 var loginInfo = new nsLoginInfo(newURL, 'chrome://scribefire', null, myUserName, aPassword, null, null);
  360.                 this._passwordManager.addLogin(loginInfo);
  361.  
  362.                 return true;
  363.             }
  364.  
  365.             return false;
  366.         }
  367.     },
  368.  
  369.     getPassword : function (aUserName, aURL) {
  370.         // Get Password Manager (does not exist in Firefox 3)
  371.         var CC_passwordManager = Components.classes["@mozilla.org/passwordmanager;1"];
  372.         var CC_loginManager = Components.classes["@mozilla.org/login-manager;1"];
  373.  
  374.         if (CC_passwordManager != null) {
  375.             // Password Manager exists so this is not Firefox 3 (could be Firefox 2, Netscape, SeaMonkey, etc).
  376.             var newURL = bfPwdPrefix + aURL;
  377.             this._passwordManager = CC_passwordManager.createInstance(Components.interfaces.nsIPasswordManagerInternal);
  378.             this._host = { value : "" };
  379.             this._user = { value : "" };
  380.             this._password = { value : "" };
  381.  
  382.             try {
  383.                 this._passwordManager.findPasswordEntry(newURL, aUserName, "", this._host, this._user, this._password);
  384.             } catch (e) {
  385.                 return false;
  386.             }
  387.  
  388.             return this._password.value;
  389.         }
  390.         else if (CC_loginManager!= null) {
  391.             // Login Manager exists so this is Firefox 3
  392.             this._passwordManager = Components.classes["@mozilla.org/login-manager;1"].getService(Components.interfaces.nsILoginManager);
  393.             var nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
  394.                                         Components.interfaces.nsILoginInfo, "init");
  395.             var hostname = bfPwdPrefix + aURL;
  396.             var formSubmitURL = null;
  397.             var httprealm = null;
  398.             var username = aUserName;
  399.  
  400.             // Get Login Manager 
  401.             var myLoginManager = CC_loginManager.getService(Components.interfaces.nsILoginManager);
  402.             var logins = myLoginManager.findLogins({}, hostname, formSubmitURL, null);
  403.  
  404.             for (var i = 0; i < logins.length; i++) {
  405.                 if (logins[i].username == username) {
  406.                     if (logins[i].formSubmitURL != 'chrome://scribefire') {
  407.                         var newLogin = new nsLoginInfo(hostname, 'chrome://scribefire', null, username, logins[i].password, null, null);
  408.                         this._passwordManager.modifyLogin(logins[i], newLogin);
  409.                     }
  410.                     
  411.                     return logins[i].password;
  412.                 }
  413.             }
  414.  
  415.             var formSubmitURL = 'chrome://scribefire';
  416.             
  417.             // Get Login Manager 
  418.             var logins = myLoginManager.findLogins({}, hostname, formSubmitURL, null);
  419.  
  420.             for (var i = 0; i < logins.length; i++) {
  421.                 if (logins[i].username == username) {
  422.                     return logins[i].password;
  423.                 }
  424.             }
  425.  
  426.             return false;
  427.         }
  428.     }
  429. }
  430.  
  431. performancingUtil.prototype.checkCategories = function(aCheck){
  432.     //check or uncheck them.
  433.     var checkList = document.getElementById('blog-sidebar-listing-categories');
  434.     for(var k=0; k < checkList.childNodes.length; k++ ){
  435.         checkList.childNodes[k].setAttribute("checked", aCheck);
  436.     }
  437. }
  438.  
  439. /*
  440.     Set the categories for the post
  441. */
  442. performancingUtil.prototype.setCategoriesSidebar = function(arrayCatList, aDoClear){
  443.     var doNotCheckClear = performancingUI.hasLabelChild('blog-sidebar-listing-categories');
  444.     
  445.     if(aDoClear || doNotCheckClear) gPerformancingUtil.clearCheckListOut('blog-sidebar-listing-categories');
  446.     
  447.     if(arrayCatList != "" && arrayCatList.length > 0){
  448.         var checkList = document.getElementById('blog-sidebar-listing-categories');
  449.         
  450.         if(gPerformancingUtil.serviceObject.addCategories){
  451.             // This API can create categories, so we'll create the checkboxes.
  452.               newCategories : for (var l = 0; l < arrayCatList.length; l++) {
  453.                 // Check if it already exists.
  454.                 for(var j = 0; j < checkList.childNodes.length; j++){
  455.                     if (checkList.childNodes[j].getAttribute('label') == arrayCatList[l]){
  456.                         checkList.childNodes[j].setAttribute("checked", true);
  457.                         continue newCategories;
  458.                     }
  459.                 }
  460.                 
  461.                 var theNewCatArray = arrayCatList[l].split(",");
  462.                 var theCategory1 = "";
  463.                 if(theNewCatArray.length > 1){
  464.                     theCategory1 = theNewCatArray[1];
  465.                 }
  466.                 gPerformancingUtil.addItemToCheckList([theNewCatArray[0]], l, 'blog-sidebar-listing-categories', null, theCategory1, "", null, true );
  467.             }
  468.         }
  469.         else{
  470.             // This API can't actually create categories, so we'll just check them if they exist.
  471.             gPerformancingUtil.checkCategories(false);
  472.             for(x=0; x < arrayCatList.length; x++ ){
  473.                 for(i=0; i < checkList.childNodes.length; i++ ){
  474.                     try{
  475.                         if(checkList.childNodes[i].getAttribute('label') == arrayCatList[x]){
  476.                             checkList.childNodes[i].setAttribute("checked", true);
  477.                         }
  478.                     }catch(e){
  479.                         // Error getting categories from object
  480.                         var localeString = performancingUI.getLocaleString('getcategorieserror', []);
  481.                         alert(localeString);
  482.                     }
  483.                 }
  484.             }
  485.         }
  486.     }else{
  487.         if(!doNotCheckClear){
  488.             if( performancingUI.hasCheckboxChildren('blog-sidebar-listing-categories') ) gPerformancingUtil.clearCheckListOut('blog-sidebar-listing-categories');
  489.             var localeString = performancingUI.getLocaleString('nocategoriesavailable', []);
  490.             var localeString2 = performancingUI.getLocaleString('notavailable', []);
  491.             //No Categories Available
  492.             gPerformancingUtil.addItemToCheckList([localeString], 0, 'blog-sidebar-listing-categories', null, localeString2, "", 'label' );
  493.         }
  494.     }
  495. }
  496.  
  497. performancingUtil.prototype.setUpAPISpecificFunctions = function(aUID){
  498.     document.getElementById("blog-sidebar-listing-4").setAttribute("hidden","true");
  499.     document.getElementById("performancing-sb-tab4").setAttribute("hidden","true");
  500.     document.getElementById("blog-sidebar-categories-addbtn").hidden = true;
  501.     
  502.     if (gPerformancingUtil.serviceObject.supportsPages) {
  503.         // Not all MT APIs will support pages.  We should do a ping to make sure this is an
  504.         // Up-to-date WP API
  505.         
  506.         // If the  getPageList API exists, then so do all the new pages APIs and a newCategory API
  507.         
  508.         var theBlogXML = gPerformancingUtil.serviceObjectXML;
  509.         var myServiceObject = gPerformancingUtil.serviceObject;
  510.         
  511.         var myResponse = myServiceObject.getPageList();
  512.         
  513.         if(myResponse){
  514.             performancing_xmlcall.sendCommand(theBlogXML.apiurl.toString(), myResponse, 'pagelistcall', "", aUID, performancing_xmlcall.processData);
  515.         }
  516.         else {
  517.             gPerformancingUtil.serviceObject.supportsPages = false;
  518.         }
  519.     }
  520.     
  521.     //User can add his own categories (i.e. in blogger)?
  522.     document.getElementById("blog-sidebar-categories-addbtn").hidden = !gPerformancingUtil.serviceObject.addCategories;
  523. }
  524.  
  525.  
  526. var gPerformancingUtil = null;
  527. function loadPerFormancingUtil(isAccountWizard) {
  528.     if(gPerformancingUtil == null){
  529.         try {
  530.             gPerformancingUtil = new performancingUtil();
  531.         } catch(e) { alert(e); }
  532.         if(!isAccountWizard){
  533.             gPerformancingUtil.init();//Load (D&D) Prefs
  534.         }
  535.     }
  536. }
  537.